<template>
	<view>
		<view class="top background-image">
		</view>
		<!-- 教师信息管理 -->
		<view class="data-box" v-if="type=='teacher'">
			<view class="cu-bar bg-white">
				<view class="action data-box-title">
					<text class="cuIcon-titles"></text> 教师功能
				</view>
			</view>
			<view class="model">
				<view class="">
					<u-grid :border="false" col="3" >
						<u-grid-item @click="goKCGL()">
							<u-avatar
								:customStyle="{marginTop:'20rpx',borderRadius:'30%'}"
								text="课"
								bgColor="#0087FC"
								shape="square"
								size="40"
								fontSize="20">
							</u-avatar>
							<text class="grid-text">课程管理</text>
						</u-grid-item>
						
						<u-grid-item @click="goQDGL()">
							<u-avatar
								:customStyle="{marginTop:'20rpx',borderRadius:'30%'}"
								text="签"
								bgColor="#0087FC"
								shape="square"
								size="40"
								fontSize="20">
							</u-avatar>
							<text class="grid-text">签到管理</text>
						</u-grid-item>
						
						<u-grid-item @click="goXSXXGL()">
							<u-avatar
								:customStyle="{marginTop:'20rpx',borderRadius:'30%'}"
								text="信"
								bgColor="#0087FC"
								shape="square"
								size="40"
								fontSize="20">
							</u-avatar>
							<text class="grid-text">学生信息管理</text>
						</u-grid-item>
					</u-grid>
				</view>
			</view>
		</view>
		<!-- 学生首页 -->
		<view class="data-box"  v-else-if="type=='student'">
			<view class="cu-bar bg-white">
				<view class="action data-box-title">
					<text class="cuIcon-titles"></text> 常用
				</view>
			</view>
			<view class="model">
				<view class="">
					<u-grid
						:border="false"
						col="3"
					>
						<u-grid-item
							v-for="(listItem,listIndex) in studentMenuList"
							:key="listIndex"
							@click="gotoPage(listItem.component)"
						>
							<u-icon
								:customStyle="{paddingTop:20+'rpx'}"
								:name="listItem.name"
								:size="22"
							></u-icon>
							<text class="grid-text">{{listItem.title}}</text>
						</u-grid-item>
					</u-grid>
					<u-toast ref="uToast" />
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { getSpCount } from '@/api/flow.js' 
	import { getRouters, getInfo } from '@/api/login.js'
	export default {
		data() {
			return {
				spCount:'',
				user:{},
				isload:true,
				currentNum:0,
				list:[],
				menus:[],
				type:'student',
				studentMenuList:[{
						name: 'photo',
						title: '课程信息',
						component:'/subPackTask/student/courseInfo/index',
                    },
                    {
                        name: 'lock',
                        title: '签到',
						component:'/subPackTask/student/kqdk/index',
                    },
                    {
                        name: 'star',
                        title: '请假',
						component:'/subPackTask/student/vacation/index',
                    }]
			}
		},
		onPullDownRefresh(){
			
		},
		created() {

		},
		onShow(){

		},
		onLoad() {},
		onReachBottom() {	},
		methods: {
			goKCGL(){
				uni.navigateTo({
					url:'/subPackTask/teacher/CourseMange/index'
				})
			},
<<<<<<< HEAD
			async getSpNum(){
				const { data } = await getSpCount();
				if(data.code == 200){
					this.spCount = String(data.data) 
				}
			},
			async getRoutersData(){
				const { data } = await getRouters();
				if(data.code === 200){
					if(data.data.length > 0){
						this.menus = data.data[0].children
					}
					uni.setStorageSync("routers", data.data)
				}
			},
			async getInfoData(){
				const { data } = await getInfo();
				if(data.code === 200){
					this.user = data.data.user
					uni.setStorageSync("loginInfo", data.data)
				}
			},
		},
		
	}
</script>

<style lang="scss">
	page{
		background-color: #f6f6f6;
		color: #333333;
	}
	
	.grid-text {
		font-size: 14px;
		color: #5b5d61;
		padding: 10rpx 0 20rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}
	
	.background-image{
		overflow: hidden;
		// padding: 0 30rpx;
		background: url("https://www.zxsl.zxmap.cn/zxch-app/2023/07/21/287c674fe2f0432fbd24ae1d3f790176.png") no-repeat center center;
		background-size: 80%;
		width: 100%;
		height: 160rpx;
	}
	
	.top{
		flex: auto;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		background-color: white;
	}
	
	.data-box{
		margin-top: 20rpx;
		background-color: #ffffff;
		/* box-shadow: 0px 0px 5px rgba(0,0,0,.1); */
		padding: 0rpx;
	}
	
	.data-box .cu-bar{
		border-bottom: solid 1px #f9f9f9;
	}
	
	.data-box-title{
		color: #333;
		font-size: 32rpx !important;
		font-weight: bold;
		text-overflow: -o-ellipsis-lastline;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	
	.cu-bar {
		display: flex;
		position: relative;
		align-items: center;
		min-height: 100rpx;
		justify-content: space-between;
	}
	
	.cu-bar .action {
		display: flex;
		align-items: center;
		height: 100%;
		justify-content: center;
		max-width: 100%;
	}
	
	.cuIcon-titles {
		display: inline-block;
		vertical-align: bottom;
		height: 40rpx;
		width: 10rpx;
		background: #0081FF;
		margin: 0 20rpx 0 25rpx;
		border-radius: 10rpx;
	}
	
	.model{
		padding: 10rpx 0;
		width: 100%;
	}
=======
			goQDGL(){
				uni.navigateTo({
					url:'/subPackTask/teacher/SignManage/index'
				})
			},
			goXSXXGL(){
				uni.navigateTo({
					url:'/subPackTask/teacher/StudentInfoMange/index'
				})
			},
			async getSpNum(){
				const { data } = await getSpCount();
				if(data.code == 200){
					this.spCount = String(data.data) 
				}
			},
			async getRoutersData(){
				const { data } = await getRouters();
				if(data.code === 200){
					if(data.data.length > 0){
						this.menus = data.data[0].children
					}
					uni.setStorageSync("routers", data.data)
				}
			},
			async getInfoData(){
				const { data } = await getInfo();
				if(data.code === 200){
					this.user = data.data.user
					uni.setStorageSync("loginInfo", data.data)
				}
			},
		},
		
	}
</script>

<style lang="scss">
	page{
		background-color: #f6f6f6;
		color: #333333;
	}
	
	.grid-text {
		font-size: 14px;
		color: #5b5d61;
		padding: 10rpx 0 20rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}
	
	.background-image{
		overflow: hidden;
		// padding: 0 30rpx;
		background: url("@/static/tab_bar/logo.png") no-repeat center center;
		background-size: 80%;
		width: 100%;
		height: 160rpx;
	}
	
	.top{
		flex: auto;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		background-color: white;
	}
	
	.data-box{
		margin-top: 20rpx;
		background-color: #ffffff;
		/* box-shadow: 0px 0px 5px rgba(0,0,0,.1); */
		padding: 0rpx;
	}
	
	.data-box .cu-bar{
		border-bottom: solid 1px #f9f9f9;
	}
	
	.data-box-title{
		color: #333;
		font-size: 32rpx !important;
		font-weight: bold;
		text-overflow: -o-ellipsis-lastline;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	
	.cu-bar {
		display: flex;
		position: relative;
		align-items: center;
		min-height: 100rpx;
		justify-content: space-between;
	}
	
	.cu-bar .action {
		display: flex;
		align-items: center;
		height: 100%;
		justify-content: center;
		max-width: 100%;
	}
	
	.cuIcon-titles {
		display: inline-block;
		vertical-align: bottom;
		height: 40rpx;
		width: 10rpx;
		background: #0081FF;
		margin: 0 20rpx 0 25rpx;
		border-radius: 10rpx;
	}
	
	.model{
		padding: 10rpx 0;
		width: 100%;
	}
>>>>>>> 1de63328cb8f22287be9813914e710a13eff2836
</style>